Skip to content

PR: Sync with Evolu upstream/common-v8 07-02-2026#28

Merged
miccy merged 37 commits intomainfrom
sync/common-v8-07-02-2026
Feb 8, 2026
Merged

PR: Sync with Evolu upstream/common-v8 07-02-2026#28
miccy merged 37 commits intomainfrom
sync/common-v8-07-02-2026

Conversation

@miccy
Copy link
Copy Markdown
Contributor

@miccy miccy commented Feb 7, 2026

Description

This pull request introduces several improvements and refactorings across the codebase, focusing on test reliability, naming consistency, developer experience, and minor build and config tweaks. The most notable changes are the unification of test fixtures for owner-related tests, the introduction of backward-compatible aliases for upstream naming, and enhancements to developer tooling.

Test and Fixture Refactoring:

  • Replaced all uses of testOwner and related variables in test files with testAppOwner and corresponding secrets, ensuring a single, consistent test fixture for owner-related tests. This affects files such as Crypto.test.ts, Owner.test.ts, and Protocol.test.ts, as well as all usages of encryption keys and owner IDs in protocol and crypto tests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

  • Expanded the test suite for Evolu by replacing a placeholder test with comprehensive tests for dependency handling and owner configuration in Evolu.test.ts.

API and Naming Consistency:

  • Added backward-compatible aliases for upstream naming: introduced Run as an alias for Runner and testCreateRun as an alias for testCreateRunner, improving compatibility and clarity. [1] [2]

Developer Experience and Tooling:

  • Added JSON schema validation for turbo.json in VSCode by updating .vscode/settings.json, enhancing editor support for TurboRepo configuration files.
  • Updated the root package.json and workspace scripts for more targeted and convenient development workflows, including a new relay script and refined dev script.
  • Improved the build script in packages/common/package.json to use TypeScript project references with --build.

Build and Config Tweaks:

  • Adjusted output paths and module settings in various tsconfig.json and package.json files for better alignment with build output and workspace conventions. [1] [2] [3] [4]

Documentation:

  • Minor documentation cleanup in dependency injection docs for clarity.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring

Checklist

  • Code follows project style guidelines
  • Tests pass locally (bun run check)
  • Documentation updated (if applicable)
  • No secrets or sensitive data included

Related Issues

Summary by CodeRabbit

  • New Features

    • Added a Run alias and a React run-context utility; appOwner can be provided via config.
  • Refactoring

    • Core APIs moved to a Task-oriented lifecycle; React hooks now use per-instance contexts and simplified platform dependency factories.
  • Bug Fixes

    • appOwner handling made robust for Promise or direct values.
  • Documentation

    • Streamlined monorepo, build and DI guidance toward Bun/Biome workflows.
  • Chores

    • Enabled incremental TypeScript build info, updated editor/schema settings and build scripts, bumped dev types; test fixtures renamed to app-owner variants.

steida and others added 29 commits February 7, 2026 20:26
(cherry picked from commit 82c941a)
- Enabled composite mode in base tsconfig with incremental builds
- Added references between packages matching their dependency graph
- Changed build scripts from tsc to tsc --build
- Removed dev scripts from library packages (no longer needed)
- Simplified pnpm dev to only start relay and web servers
- Added pnpm relay for mobile development workflow
- Updated turbo.json schema URL and removed ^dev dependency
- Added .tsBuildInfo to gitignore

After pnpm build, the IDE has full cross-package types without
needing a background watcher. This reduces CPU/memory usage and
eliminates delays waiting for Turbo to rebuild on changes.

(cherry picked from commit f79f9f8)
(cherry picked from commit cadf5c0)

# Conflicts:
#	pnpm-lock.yaml
Removed allowJs (not needed since all source is TypeScript), removed
moduleResolution: "node" from base tsconfig, removed redundant
exclude: ["node_modules"] from base, fixed rootDir from "src" to
"." where needed, and added test + vitest config to include arrays

(cherry picked from commit 6cf8870)
Updated types, exports, and files fields from dist/ to dist/src/ to
match the new rootDir: "." tsconfig layout

(cherry picked from commit bba6488)
Added dependsOn: ["^build"] so dependent packages are built before
starting dev servers

(cherry picked from commit 9950864)
Consistent wording pattern "Creates Run for X with Y" and expanded
descriptions for Node.js, web, and React Native createRun functions.
Removed redundant JSDoc from CreateRun interface

(cherry picked from commit 0618f54)
(cherry picked from commit 30ee124)

# Conflicts:
#	packages/common/test/Task.test.ts
Replaced class-style creation with Task-based createEvolu returning
Task<Evolu<S>, never, EvoluPlatformDeps>. Simplified Evolu interface:
made AsyncDisposable, changed appOwner from Promise to direct value,
renamed externalAppOwner config to appOwner, commented out mutations
and error store pending reimplementation. Added tests for new API

(cherry picked from commit eff36aa)
Simplified createEvoluDeps across platforms to pass through ReloadAppDep
directly. Commented out SharedWorker, MessageChannel, and localAuth code
pending redesign. Added createEvoluDeps to React Web with flushSync.
Updated React Native shared module and Expo entry points

(cherry picked from commit 26bc572)
Moved hooks from src/ to src/local-first/ to mirror common package
structure. Replaced EvoluProvider/useEvolu/createUseEvolu pattern with
createEvoluContext using React use() and Context. Added createRunContext
for typed Run context. Removed useEvoluError (error store redesign).
Updated index exports

(cherry picked from commit ccf4da1)
Changed appOwnerState to use evolu.appOwner directly instead of
awaiting a promise

(cherry picked from commit 83f6d3d)

# Conflicts:
#	packages/svelte/src/lib/index.svelte.ts
Deleted useEvoluError (error store being redesigned) and alphabetically
sorted exports in index.ts

(cherry picked from commit 304da2d)
(cherry picked from commit 6c793b2)
(cherry picked from commit 6d98bd2)
(cherry picked from commit 1563099)
(cherry picked from commit 84f907e)
Refactor the note in the dependency-injection docs to a single concise sentence. Removed the clause suggesting Console likely replaces a Logger and reflowed the text for clarity.

(cherry picked from commit cdf7f89)
@miccy miccy requested a review from Jakub-coding99 February 7, 2026 20:57
@miccy miccy requested a review from Copilot February 7, 2026 20:57
@miccy miccy self-assigned this Feb 7, 2026
@miccy miccy added docs Improvements or additions to documentation upstream Needs cherry-pick or merge from upstream feat New feature or request update Update libs and deps labels Feb 7, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

Converts Evolu to a Task-based local-first API with new platform deps, shifts React hooks to context-based usage, standardizes TypeScript build/configs across the monorepo, renames owner test fixtures to appOwner variants, and updates package scripts/exports and several platform wiring helpers.

Changes

Cohort / File(s) Summary
Docs & workspace config
​.github/copilot-instructions.md, .gitignore, .vscode/settings.json, turbo.json, biome_errors.txt
Rewrote Copilot guidance, added *.tsBuildInfo to .gitignore, added VSCode schema, updated Turbo schema and dev task dependency, and removed a stale Biome errors report.
Workspace TypeScript configs
packages/tsconfig.json, packages/tsconfig/base.json, packages/tsconfig/nextjs.json, packages/tsconfig/*.json, packages/tsconfig/expo.json, packages/tsconfig/react-native.json
Introduced workspace-level tsconfigs and per-target configs; enabled composite/incremental builds, added tsBuildInfo files and project references; removed many allowJs entries and adjusted roots/includes.
Package scripts & exports
package.json, packages/*/package.json, apps/*/package.json, examples/*/package.json
Standardized build scripts to tsc --build, removed several dev scripts, bumped various dev/runtime deps (@types/*, react-native, svelte), added root relay script, and adjusted Node export mappings.
Core Task API
packages/common/src/Task.ts, packages/nodejs/src/Task.ts, packages/web/src/Task.ts
Added alias export type Run<D = unknown> = Runner<D>; removed some public overloads on runner creation; updated JSDoc for platform Runner creators (Node/web/React Native).
Evolu local-first API
packages/common/src/local-first/Evolu.ts, packages/common/src/local-first/Protocol.ts
Major API reshape toward Task-based createEvolu signature and curated EvoluDeps/EvoluPlatformDeps; added appOwner config fields; removed many synchronous mutation/query public types; added pack() helper in Protocol.
React: context & hooks migration
packages/react/src/EvoluContext.ts (removed), packages/react/src/local-first/EvoluContext.tsx, packages/react/src/EvoluProvider.tsx, packages/react/src/Task.tsx, packages/react/src/index.ts, packages/react/src/local-first/*.ts, packages/react/src/useEvolu.ts
Removed top-level EvoluContext, added per-instance Evolu context factory and Run context helper, migrated local-first hooks to use use(EvoluContext), and updated exports to local-first modules.
React Native / shared deps
packages/react-native/src/shared.ts, packages/react-native/src/createExpoDeps.ts, packages/react-native/src/exports/*.ts, packages/react-native/package.json
Replaced createSharedEvoluDeps with createEvoluDeps(deps: ReloadAppDep), removed in-file console/sqlite wiring, added createSharedLocalAuth, and adjusted RN export wiring to use simplified factory.
Web / react-web Evolu wiring
packages/web/src/local-first/Evolu.ts, packages/react-web/src/local-first/Evolu.ts
Removed web localAuth and worker/channel wiring; createEvoluDeps now delegates to common implementation; react-web adds flushSync into web deps.
Tests & fixtures
packages/common/test/local-first/_fixtures.ts, packages/common/test/local-first/*.test.ts, packages/common/test/Crypto.test.ts, packages/common/src/Test.ts
Renamed owner fixtures from testOwner*testAppOwner* and propagated across protocol, relay, storage, owner, and evolu tests; added testCreateRun alias for test helper.
Per-package tsconfig adjustments
apps/*/tsconfig.json, packages/*/tsconfig.json (react, react-web, react-native, nodejs, svelte, vue, web)
Added rootDir/tsBuildInfoFile, references, removed allowJs, and narrowed include arrays across many package tsconfigs.
Examples & app-level refactors
examples/react-expo/*, apps/relay/*, apps/web/src/app/(docs)/*
Large componentization/refactor in examples/react-expo; updated apps/relay start path; trimmed docs guidance; removed strictNullChecks from apps/web/tsconfig.
Misc small helpers & hooks
packages/react/src/local-first/use*.ts, packages/react/src/Task.tsx, packages/common/src/local-first/Protocol.ts
Hook implementations switched to context use(EvoluContext) access; added React Run context helper; small helper pack() exported from Protocol.

Sequence Diagram(s)

sequenceDiagram
participant Client as Client (app)
participant createEvolu as createEvolu (Task factory)
participant PlatformDeps as EvoluPlatformDeps
participant Worker as Worker / Storage

rect rgba(180,220,255,0.5)
Client->>createEvolu: call createEvolu(config)
createEvolu->>PlatformDeps: assemble platform deps (reloadApp, console, randomBytes, etc.)
createEvolu->>Worker: initialize or delegate worker via Task run
Worker-->>createEvolu: worker ready (Task resolves Evolu)
createEvolu-->>Client: returns Task/fiber resolving to Evolu
end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nibble lines and rename seeds,
Tasks hop in place of older deeds,
Contexts planted, fixtures sprout,
Builds write maps and lint bugs out,
A tidy burrow, code takes leaps — hooray! 🌱


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@miccy miccy changed the title Sync/common v8 07 02 2026 PR: Sync with Evolu upstream/common-v8 07-02-2026 Feb 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs/refactors several parts of the monorepo (tests, platform adapters, and build config) to improve consistency with upstream naming and to move more packages to tsc --build project references.

Changes:

  • Refactors owner-related test fixtures to a unified testAppOwner* naming and expands createEvolu tests.
  • Introduces backward-compatible aliases (Run for Runner, testCreateRun for testCreateRunner) and starts migrating React usage toward a context/fiber-based API.
  • Updates TS build configuration across packages (project references, tsBuildInfoFile, composite builds) and tweaks Turbo/workspace scripts.

Reviewed changes

Copilot reviewed 66 out of 68 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
turbo.json Updates Turbo schema URL and changes dev task dependency behavior.
packages/web/tsconfig.json Adds project references/build-info settings for TS build mode.
packages/web/src/local-first/Evolu.ts Simplifies web deps creation (commented-out legacy worker/auth wiring).
packages/web/src/Task.ts JSDoc wording change.
packages/web/package.json Switches to tsc --build for dev/build scripts.
packages/vue/tsconfig.json Adds project references/build-info settings; narrows includes.
packages/vue/src/useEvoluError.ts Removes Vue useEvoluError hook implementation.
packages/vue/src/index.ts Stops exporting useEvoluError.
packages/vue/package.json Switches to tsc --build; removes dev script.
packages/tsconfig/nextjs.json Updates target and trims options/include/exclude to be a pure base config.
packages/tsconfig/base.json Enables composite/incremental by default; tweaks compiler options.
packages/tsconfig.json Adds solution-style TS project references for packages.
packages/svelte/tsconfig.json Adds rootDir, composite/incremental, references, tsBuildInfoFile.
packages/svelte/src/lib/index.svelte.ts Updates app owner state docs and makes appOwner handling promise-like.
packages/svelte/package.json Switches to tsc --build for dev/build.
packages/react/tsconfig.json Adds rootDir/references/tsBuildInfoFile; narrows includes.
packages/react/src/useEvolu.ts Points to new context location and simplifies JSDoc.
packages/react/src/local-first/useSyncState.ts Switches from useEvolu() to use(EvoluContext).
packages/react/src/local-first/useQuerySubscription.ts Switches from useEvolu() to use(EvoluContext).
packages/react/src/local-first/useQuery.ts Switches from useEvolu() to use(EvoluContext).
packages/react/src/local-first/useQueries.ts Switches from useEvolu() to use(EvoluContext); minor formatting.
packages/react/src/local-first/useOwner.ts Switches from useEvolu() to use(EvoluContext).
packages/react/src/local-first/useIsSsr.ts Adds SSR detection hook to avoid hydration mismatches.
packages/react/src/local-first/EvoluContext.tsx Adds new React context factory/provider for Evolu fiber.
packages/react/src/index.ts Re-exports reshuffled modules; removes previous provider/hook exports.
packages/react/src/createUseEvolu.ts Removes typed hook helper.
packages/react/src/Task.tsx Adds Run context factory/provider.
packages/react/src/EvoluProvider.tsx Removes old provider component.
packages/react/src/EvoluContext.ts Removes old context definition.
packages/react/package.json Switches to tsc --build; removes dev script.
packages/react-web/tsconfig.json Adds references/build-info settings.
packages/react-web/src/local-first/Evolu.ts Adds React-web deps helper injecting flushSync.
packages/react-web/package.json Switches to tsc --build for dev/build.
packages/react-native/tsconfig.json Adds references/build-info settings; adjusts rootDir.
packages/react-native/src/shared.ts Refactors RN deps creation and local auth helper; comments out legacy code.
packages/react-native/src/exports/expo-sqlite.ts Reworks Expo entrypoint to export createEvoluDeps.
packages/react-native/src/exports/expo-op-sqlite.ts Comments out all exports (entrypoint becomes empty).
packages/react-native/src/exports/bare-op-sqlite.ts Switches to new shared deps function name.
packages/react-native/src/createExpoDeps.ts Comments out previous Expo deps factory implementation.
packages/react-native/src/Task.ts JSDoc wording change.
packages/react-native/package.json Switches to tsc --build; removes dev script.
packages/nodejs/tsconfig.json Adds references/build-info settings; adjusts rootDir.
packages/nodejs/src/Task.ts Updates JSDoc wording/structure for Node Runner.
packages/nodejs/package.json Adjusts package exports map; switches to tsc --build.
packages/common/tsconfig.json Adds tsBuildInfoFile and removes allowJs.
packages/common/test/local-first/_fixtures.ts Renames owner fixtures to testAppOwner*.
packages/common/test/local-first/Storage.test.ts Updates tests to use renamed owner fixtures.
packages/common/test/local-first/Relay.test.ts Updates tests to use renamed owner fixtures.
packages/common/test/local-first/Protocol.test.ts Updates tests to use renamed owner fixtures.
packages/common/test/local-first/Owner.test.ts Updates tests to use renamed owner fixtures.
packages/common/test/local-first/Evolu.test.ts Replaces placeholder with tests for deps identity + appOwner behavior.
packages/common/test/Crypto.test.ts Updates crypto test to use renamed owner fixture.
packages/common/src/Test.ts Adds testCreateRun alias for upstream naming.
packages/common/src/Task.ts Adds Run type alias and minor JSDoc tweaks.
packages/common/package.json Switches to tsc --build; removes dev script.
package.json Updates root dev script and adds relay script.
examples/react-expo/package.json Renames start script to _start.
examples/react-expo/app/index.tsx Replaces full demo with minimal context/run sample; keeps old code commented.
apps/web/tsconfig.json Minor config cleanup (removes strictNullChecks, adjusts include).
apps/web/src/app/(playgrounds)/playgrounds/minimal/EvoluMinimalExample.tsx Replaces minimal playground with placeholder + new context/run wiring.
apps/web/src/app/(playgrounds)/playgrounds/full/EvoluFullExample.tsx Replaces full playground with TODO placeholder.
apps/web/src/app/(docs)/docs/dependency-injection/page.mdx Minor wording cleanup.
apps/relay/tsconfig.json Simplifies compilerOptions.
apps/relay/package.json Fixes start path to match emitted output structure.
.vscode/settings.json Adds Turbo JSON schema association for VS Code.
.gitignore Adds *.tsBuildInfo ignore pattern.
.github/copilot-instructions.md Updates project guidelines doc structure/content.

Comment on lines +1 to +11
export * from "./local-first/EvoluContext.js";
export * from "./local-first/useIsSsr.js";
export * from "./local-first/useOwner.js";
export * from "./local-first/useQueries.js";
export * from "./local-first/useQuery.js";
export * from "./local-first/useQuerySubscription.js";
export * from "./Task.js";
export * from "./useEvolu.js";
export * from "./useEvoluError.js";
// TODO: Re-enable useSyncState export after owner-api refactoring is complete
// export * from "./useSyncState.js";
export * from "./useIsSsr.js";
export * from "./useOwner.js";
export * from "./useQueries.js";
export * from "./useQuery.js";
export * from "./useQuerySubscription.js";

// export * from "./local-first/useSyncState.js"; TODO: Update it for the owner-api
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This index no longer re-exports createUseEvolu/EvoluProvider, but the repo still imports them (e.g. apps/web/.../multitenant/EvoluMultitenantExample.tsx and multiple examples). As-is, the monorepo won’t typecheck/build. Either restore the exports (possibly as backward-compatible aliases) or update all downstream call sites to the new context-based API in the same PR.

Copilot uses AI. Check for mistakes.
Comment on lines 2 to 6
export * from "./EvoluProvider.js";
export * from "./provideEvolu.js";
export * from "./useEvolu.js";
export * from "./useEvoluError.js";
export * from "./useOwner.js";
export * from "./useQueries.js";
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useEvoluError was removed from the package entrypoint (and the implementation file deleted). This is a breaking public API change; either keep a deprecated alias export or update all documented/public usage accordingly and bump appropriately.

Copilot uses AI. Check for mistakes.
@miccy
Copy link
Copy Markdown
Contributor Author

miccy commented Feb 7, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Feb 7, 2026

@miccy I've opened a new pull request, #29, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 7 commits February 7, 2026 21:11
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
…ntroduce `encryptionKey` to Evolu config.
…ration

- Uncommented Evolu interface methods: insert/update/upsert/resetAppOwner/reloadApp/exportDatabase
- Changed appOwner to Promise<AppOwner> for async resolution
- Added createLoadingPromises, createErrorStore helpers
- Refactored react-expo components to top-level with prop drilling
- Fixed Biome linting: import organization, unused variables

Worker integration still TODO - mutations validate but don't persist
- New packages/tsconfig/react-native.json for bare RN projects
- New packages/tsconfig/expo.json extending react-native config
- Update examples/react-expo to use our expo.json instead of expo/tsconfig.base
- Self-contained configs without erasableSyntaxOnly for better IDE compatibility
- Fix Biome import ordering in index.tsx
…cies across various packages and examples.
@miccy miccy merged commit 147ff8b into main Feb 8, 2026
5 checks passed
@miccy miccy deleted the sync/common-v8-07-02-2026 branch February 10, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation feat New feature or request update Update libs and deps upstream Needs cherry-pick or merge from upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants